﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="newslist.aspx.cs" Inherits="lcmyjobs.Web.Admin.newslist" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>文章管理</title>
    <link href="../css/AdminFrame.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/mybasic.js" type="text/javascript"></script>
  
</head>
<body>
    <form id="form1" runat="server">
    <div class="rightCenter">
        <div class="rightBack">
            <div class="rightContentTop">
                <ul>
                    <li ><a href="newsadd.aspx">添加文章</a> </li>
                    <li class="cur"><a href="newslist.aspx">文章管理</a> </li>
                </ul>
            </div>
            <div class="rightContentMiddle">
                <asp:GridView ID="GridView1" runat="server" Width="100%" 
                    DataKeyNames="nid" AutoGenerateColumns="False" RowStyle-HorizontalAlign="Center"
                    OnRowDataBound="GridView1_RowDataBound" OnRowDeleting="GridView1_RowDeleting"
                    EnableModelValidation="True" CssClass="grid" GridLines="None" 
                    onrowcommand="GridView1_RowCommand">
                    <Columns>
                        <asp:TemplateField HeaderText="标题" SortExpression="ntitle">
                        <HeaderTemplate>
                        <input id="Checkbox1" type="checkbox" onclick="checkall(this)" />
                        标题
                    </HeaderTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ntitle") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chku" runat="server" />&nbsp;
                                <asp:HyperLink ID="hy_title" runat="server" Text='<%# Eval("ntitle") %>' NavigateUrl='<%#"shownews.aspx?id="+ Eval("nid") %>' Target="_blank"></asp:HyperLink>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" CssClass="tdleftmargin"/>
                            <ItemStyle  CssClass="tdleftmargin" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="ntime" HeaderText="发布时间" DataFormatString="{0:yyyy-MM-dd H:mm}" SortExpression="ntime" ItemStyle-HorizontalAlign="Center">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="ntname" HeaderText="类别" 
                            ItemStyle-HorizontalAlign="Center" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="truename" HeaderText="作者" SortExpression="ntid" 
                            ItemStyle-HorizontalAlign="Center" Visible="False">
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="文章类型" Visible="False">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("isrmname") %>'></asp:Label>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("istjname") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:HyperLinkField HeaderText="编辑" ControlStyle-Width="50" DataNavigateUrlFields="nid"
                            DataNavigateUrlFormatString="newsadd.aspx?id={0}" Text="编辑">
                            <ControlStyle Width="50px"></ControlStyle>
                        </asp:HyperLinkField>
                        
                        <asp:TemplateField HeaderText="推荐文章">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbn_tj" runat="server" CommandArgument='<%# Bind("nid") %>'
                                    CommandName="lbn_tj" Text='<%# Bind("TJ_command") %>'></asp:LinkButton>

                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="热门文章">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbn_rm" runat="server" CommandArgument='<%# Bind("nid") %>' 
                                    CommandName="lbn_rm"  Text='<%# Bind("RM_command") %>'></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                      
                        <asp:TemplateField ControlStyle-Width="50" HeaderText="删除">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                            <ControlStyle Width="50px"></ControlStyle>
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle HorizontalAlign="Center"></RowStyle>
                </asp:GridView>
                <div class="pagerstyle"><webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                    PageSize="15" AlwaysShowFirstLastPageNumber="True" CustomInfoTextAlign="Left"
                    FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" NumericButtonCount="10"
                    PrevPageText="上一页" CssClass="paginator" CurrentPageButtonClass="" CustomInfoHTML="第 %CurrentPageIndex% 页 共 %PageCount%页 %RecordCount%条记录 "
                    LayoutType="Table" ShowCustomInfoSection="Left" ShowNavigationToolTip="True"
                    ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextAfterPageIndexBox="&nbsp;页"
                    TextBeforePageIndexBox="转到第">
                </webdiyer:AspNetPager></div>
                
                <table border="0" cellpadding="0" cellspacing="1" style="width: 100%; margin-top:15px;">
                    <tr>
                        <td style="width: 1px;">
                        </td>
                        <td align="left">
                        <div style=" margin:0 auto; width:150px;">
                            <asp:Button ID="btnDelete" runat="server" Text="删除" OnClick="btnDelete_Click" OnClientClick= "return confirm('确认要删除吗？')" CssClass="bgbtn" style=" margin:0 auto;"/>
                        </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
